package comprasdiretas.entity;

import comprasdiretas.entity.UsuarioEntity;
import java.io.Serializable;
import java.lang.String;
import javax.persistence.*;

/**
 * Entity implementation class for Entity: ServidorEntity
 *
 */
@NamedQueries({@NamedQuery(name="procurarServidorPeloID", query="SELECT s FROM ServidorEntity s WHERE s.idServidor LIKE :idServidor ORDER BY s.nome"),
	@NamedQuery(name="procurarServidorPelaMatriculaSIAPE", query="SELECT s FROM ServidorEntity s WHERE s.matriculaSIAPE LIKE :matriculaSIAPE ORDER BY s.matriculaSIAPE"),
	@NamedQuery(name="procurarServidorPeloNome", query="SELECT s FROM ServidorEntity s WHERE UPPER(s.nome) LIKE :nome ORDER BY s.nome"),
	@NamedQuery(name="Servidor.ProcurarServidorPeloLogin", query="SELECT s FROM ServidorEntity s WHERE s.usuario.login LIKE :login ORDER BY s.nome")})
@Entity
@Table(name="Servidor", schema="comprasdiretasdb")
public class ServidorEntity implements Serializable {

	   
	@Id
	@Column(name="idServidor")
	@TableGenerator(allocationSize=1,initialValue=1,name="Servidor_SEQ", 
			table="sequence",pkColumnName="SEQ_NAME", valueColumnName="SEQ_COUNT", 
			schema="comprasdiretasdb")
	@GeneratedValue(strategy=GenerationType.TABLE, generator="Servidor_SEQ")
	private int idServidor;
	@Column(name="matriculaSIAPE")
	private String matriculaSIAPE;
	@OneToOne
	@JoinColumn(name="usuario")
	private UsuarioEntity usuario;
	@Column(name="nome")
	private String nome;
	
	private static final long serialVersionUID = 1L;

	public ServidorEntity() {
		super();
	}   
	
	public ServidorEntity(String matriculaSIAPE, UsuarioEntity usuario,String nome) {
		this.matriculaSIAPE=matriculaSIAPE;
		this.usuario=usuario;
		this.nome=nome;
	}   
	
	public int getIdServidor() {
		return this.idServidor;
	}

	public void setIdServidor(int idServidor) {
		this.idServidor = idServidor;
	}   
	public String getMatriculaSIAPE() {
		return this.matriculaSIAPE;
	}

	public void setMatriculaSIAPE(String matriculaSIAPE) {
		this.matriculaSIAPE = matriculaSIAPE;
	}   
  
	public UsuarioEntity getUsuario() {
		return this.usuario;
	}

	public void setUsuario(UsuarioEntity usuario) {
		this.usuario = usuario;
	}   
	public String getNome() {
		return this.nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}
   
}
